package com.paper.tiger.easy.rpc.core;

/**
 * [简要描述]: 客户端向注册中心注册服务信息
 * [详细描述]:
 *
 * @author ZouHaiBo
 * @version 1.0, 2021/5/28 17:28
 * @since JDK 1.8
 */
public class Stub
{
    /**
     * 提供服务id
     */
    private String ip;

    /**
     * 端口
     */
    private Integer port;

    /**
     * ip:port
     */
    private String hostKey;

    /**
     * 实现类全限定名
     */
    private String implClassName;
    /**
     * 接口全限定名
     */
    private String interfaceClassName;

    /**
     * spring 容器中的id
     */
    private String serviceId;

    /**
     * 服务名称 - 如果服务名称相同，他们是集群
     */
    private String appName;

    public String getIp()
    {
        return ip;
    }

    public void setIp(String ip)
    {
        this.ip = ip == null ? null : "".equals(ip.trim()) ? null : ip.trim();
    }

    public Integer getPort()
    {
        return port;
    }

    public void setPort(Integer port)
    {
        this.port = port;
    }

    public String getHostKey()
    {
        return hostKey;
    }

    public void setHostKey(String hostKey)
    {
        this.hostKey = hostKey == null ? null : "".equals(hostKey.trim()) ? null : hostKey.trim();
    }

    public String getAppName()
    {
        return appName;
    }

    public void setAppName(String serviceName)
    {
        this.appName = serviceName == null ? null : "".equals(serviceName.trim()) ? null : serviceName.trim();
    }


    public void setImplClass(Class implClass)
    {

        this.implClassName = implClass.getName();
    }

    public String getImplClass()
    {
        return implClassName;
    }

    public void setInterfaceClass(Class interfaceClass)
    {
        this.interfaceClassName = interfaceClass.getName();
    }

    public String getInterfaceClass()
    {
        return interfaceClassName;
    }

    public String getServiceId()
    {
        return serviceId;
    }

    public void setServiceId(String serviceId)
    {
        this.serviceId = serviceId == null ? null : "".equals(serviceId.trim()) ? null : serviceId.trim();
    }




}
